package com.esri.core.tasks.ags.geoprocessing;

import com.esri.core.internal.util.d;
import com.esri.core.io.EsriServiceException;
import com.tencent.smtt.sdk.TbsVideoCacheTask;
import java.net.MalformedURLException;
import java.net.URL;
import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.JsonToken;

/* loaded from: classes.dex */
public class GPDataFile extends GPParameter {
    private static final long serialVersionUID = 1;
    private URL url;

    public URL getUrl() {
        return this.url;
    }

    public void setUrl(String str) {
        try {
            this.url = new URL(str);
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
    }

    public GPDataFile(String str) {
        setParamName(str);
        this.dataType = "GPDataFile";
    }

    public GPDataFile() {
        this("");
    }

    @Override // com.esri.core.tasks.ags.geoprocessing.GPParameter
    public String generateValueParams() throws Exception {
        return d.a(this);
    }

    @Override // com.esri.core.tasks.ags.geoprocessing.GPParameter
    public void fromJson(JsonParser jsonParser) throws Exception {
        if (!d.c(jsonParser)) {
            throw new EsriServiceException("Unable to parse the Response for thie GPDataFile.");
        }
        while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
            String currentName = jsonParser.getCurrentName();
            jsonParser.nextToken();
            if (TbsVideoCacheTask.KEY_VIDEO_CACHE_PARAM_URL.equals(currentName)) {
                this.url = new URL(jsonParser.getText());
            } else {
                jsonParser.skipChildren();
            }
        }
    }

    public int hashCode() {
        URL url = this.url;
        return 31 + (url == null ? 0 : url.hashCode());
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj != null && getClass() == obj.getClass()) {
            GPDataFile gPDataFile = (GPDataFile) obj;
            URL url = this.url;
            if (url == null) {
                if (gPDataFile.url != null) {
                    return false;
                }
            } else if (!url.equals(gPDataFile.url)) {
                return false;
            }
            return true;
        }
        return false;
    }
}
